﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Logger
{
    public class LogMessageTemplate
    {
        /// <summary>
        /// 记录日志时的时间
        /// </summary>
        [JsonProperty("log_timestamp")]
        public long LogTimestamp { get; set; }

        /// <summary>
        /// 应用id
        /// </summary>
        [JsonProperty("app_id")]
        public string AppId { get; set; }
        /// <summary>
        /// 应用名称
        /// </summary>
        [JsonProperty("app_name")]
        public string AppName { get; set; }
        /// <summary>
        /// 主机名
        /// </summary>
        [JsonProperty("host_name")]
        public string HostName { get; set; }

        /// <summary>
        /// 日志级别
        /// </summary>
        [JsonProperty("level")]
        public string Level { get; set; }

        /// <summary>
        /// 日志名
        /// </summary>
        [JsonProperty("logger_name")]
        public string LoggerName { get; set; }

        /// <summary>
        /// 日志信息
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// 异常信息
        /// </summary>
        [JsonProperty("exception")]
        public LogExceptionTemplate Exception { get; set; }
        /// <summary>
        /// 应用节点ID
        /// </summary>
        [JsonProperty("node_id")]
        public string NodeId { get; set; }
        /// <summary>
        /// 线程ID
        /// </summary>
        [JsonProperty("thread_id")]
        public string ThreadId { get; set; }
        /// <summary>
        /// 请求ID
        /// </summary>
        [JsonProperty("request_id")]
        public string RequestId { get; set; }
        /// <summary>
        /// 环境
        /// </summary>
        [JsonProperty("env")]
        public string Env { get; set; }
    }
    /// <summary>
    /// 异常信息实体
    /// </summary>
    public class LogExceptionTemplate
    {
        /// <summary>
        /// 类名
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [JsonProperty("message")]
        public string Message { get; set; }

        /// <summary>
        /// 堆栈信息
        /// </summary>
        [JsonProperty("stack_trace")]
        public string StackTrace { get; set; }
    }
}
